//打开窗口
function openwindow(str_url,width,height,target){
	if(str_url=='') return false;
	
	if(target==null || target=='') target = "_blank";
	//if(height==null || height=='') height = screen.height;
	//if(width==null || width=='') width = screen.width;
	var str_style = "";
	if (width==null || width=='' || height==null || height=='')
	{
	 	//str_style = "toolbar=0, menubar=0, scrollbars=1, resizable=1, fullscreen=yes";
	 	str_style = "toolbar=0, menubar=0, scrollbars=1, resizable=1, width=" + width + ", height=" + height + ", left=" + left + ", top=" + top;
	 	var newwindow = window.open(str_url,target,str_style);
		newwindow.moveTo(0,0);
		newwindow.resizeTo(screen.availWidth,screen.availHeight)
	}
	else
	{
		var left = (screen.width - width)/2;
		var top = (screen.height - height)/2;
	
		//var str_style = "toolbar=0, menubar=0, scrollbars=1, resizable=1, width=" + width + ", height=" + height + ", left=" + left + ", top=" + top;
	 	str_style = "toolbar=0, menubar=0, scrollbars=1, resizable=1, width=" + width + ", height=" + height + ", left=" + left + ", top=" + top;
	 	window.open(str_url,target,str_style);
	}
	//????
	//width = screen.width - 15;;
	//height = screen.height - 15;
	
	
}
function checkfloat(e) {

   if(e.keyCode==46 || e.keyCode==45)
      return true;
  if (e.keyCode>=48 && e.keyCode<=57)
    return true;
  else
    return false;
}
//只能输入整数
function checkint(e) {
  if ((e.keyCode>=48) && (e.keyCode<=57))
    return true;
  else
    return false;
}
//=============ljm=================
	//关闭新开窗口时，将Session里的标段ID清除
	function clearSession(){	
		var url=basePath+"project/bidSect/clearSession.jsp";
		send_request(url);
	}
	var http_request = false;
	var id2=0;
	function send_request(url) {//初始化、指定处理函数、发送请求的函数
		http_request = false;
		//开始初始化XMLHttpRequest对象
		if(window.XMLHttpRequest) { //Mozilla 浏览器
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {//设置MiME类别
				http_request.overrideMimeType('text/xml');
			}
		}
		else if (window.ActiveXObject) { // IE浏览器
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
		if (!http_request) { // 异常，创建对象实例失败
			window.alert("不能创建XMLHttpRequest对象实例.");
			return false;
		}
		http_request.onreadystatechange = processRequest;
		// 确定发送请求的方式和URL以及是否同步执行下段代码
		http_request.open("GET", url, false);
		http_request.send(null);
	}
	// 处理返回信息的函数
	function processRequest()
	 {
	    if (http_request.readyState == 4)
	     { // 判断对象状态
	        if (http_request.status == 200)
	         { // 信息已经成功返回，开始处理信息
		    	var returnStr = http_request.responseText;
	         }
	        else 
	         { //页面不正常
	            alert("您所请求的页面有异常。");
	         }
	    }
	 }
	 
	 //选择单位
	 //参数说明:deptType:部门类型;deptName:存放部门名称的输入域Id;deptId:存放部门Id的隐含域Id;basePath:页面路径;selType:部门选择类型,全选还是有条件选择
	function selectDept(deptType,deptName,deptId,basePath,selType){
		var selDeptId=document.getElementById(deptId).value;//已选择的部门Id
		window.open(basePath+"/project/BidSectAction.do?doClass=selectDept&deptType="+deptType+"&deptName="+deptName+"&deptId="+deptId+"&selType="+selType+"&selDeptId="+selDeptId,"","toolbar=0,location=0,status=0,menubar=0,width=450,height=250,top=30,left=30,scrollbars=auto");
	}
	//将当前页面保存为word文档,调用时传页面的location.href即可
	 function unloadWord(url){
			var specialSymbol=/&/g;
			
			url=url.replace("?","!");
			url=url.replace(specialSymbol,"@");
			
		    location.href='unload_word.jsp?url='+url;
	}
	
//=============ljm=================